Skip to content

Add build datetime to version command output #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?

Enhanced an existing command.

  • What is the current behavior?

version command doesn't print datetime of the build in use.

  • What is the new behavior?

version command prints datetime of the build in use if set.
ldflags are used to set build datetime with -X github.com/arduino/arduino-cli/version.date.

  • Does this PR introduce a breaking change?

No.

  • Other information:

None.


See how to contribute

@silvanocerza silvanocerza self-assigned this Nov 30, 2020
@silvanocerza silvanocerza force-pushed the scerza/version-datetime branch 2 times, most recently from ef316bc to bbcbafa Compare November 30, 2020 16:17
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of completeness, you could do the same in Taskfile.yml. Something like:

  TIMESTAMP:
    sh: echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
  LDFLAGS: >
    -ldflags '-X github.com/arduino/arduino-cli/version.commit={{.COMMIT}}
    -X github.com/arduino/arduino-cli/version.date={{.TIMESTAMP}}'

@silvanocerza silvanocerza force-pushed the scerza/version-datetime branch from bbcbafa to ecb74dd Compare December 1, 2020 13:04
@silvanocerza silvanocerza force-pushed the scerza/version-datetime branch from ecb74dd to f96b6d3 Compare December 1, 2020 13:16
@silvanocerza silvanocerza merged commit 9885078 into master Dec 2, 2020
@silvanocerza silvanocerza deleted the scerza/version-datetime branch December 2, 2020 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants